package com.zhentao.Exception.exceptions;



import com.zhentao.Exception.enums.BaseExceptionEnum;
import lombok.Data;

@Data
public class ApiException extends RuntimeException{

	public Integer status;
	public String msg;
	public ApiException(BaseExceptionEnum baseExceptionEnum) { //通过 BaseExceptionEnum
		// 枚举构造直接指定错误码和消息构造
		super(baseExceptionEnum.getMessage());
		this.status = baseExceptionEnum.getStatus();
		this.msg = baseExceptionEnum.getMessage();
	}
	public ApiException(Integer status, String message) {
		super(message);
		this.status=status;
		this.msg=message;
	}

}
